<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Bezdelnick
 * Date: 25.04.13
 * Time: 0:39
 * To change this template use File | Settings | File Templates.
 */
require_once("Config.php");
require_once("persistence/Actor.php");
require_once("dao/ActorDao.php");

$actorDao = new ActorDao();

if (isset($_POST['load_by_film_id']))
    $actors = $actorDao->loadByFilmId($_POST['load_by_film_id']);
else
    $actors = $actorDao->load();
?>

<select name="film_actors[]" multiple="multiple" class="jquery-multi-select">
    <? foreach ($actors as $actor) { ?>
    <option value="<?= $actor->getId() ?>"> <?= $actor->getFirstName() . " " . $actor->getLastName() ?> </option>
    <? } ?>
</select>